<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>module Rake::DSL - rake: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="module">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
        
<div id="includes-section" class="nav-section">
  <h3>Included Modules</h3>

  <ul class="link-list">
    <li><a class="include" href="FileUtilsExt.html">Rake::FileUtilsExt</a>
  </ul>
</div>

        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-i-desc">#desc</a>
    <li ><a href="#method-i-directory">#directory</a>
    <li ><a href="#method-i-file">#file</a>
    <li ><a href="#method-i-file_create">#file_create</a>
    <li ><a href="#method-i-import">#import</a>
    <li ><a href="#method-i-multitask">#multitask</a>
    <li ><a href="#method-i-namespace">#namespace</a>
    <li ><a href="#method-i-rule">#rule</a>
    <li ><a href="#method-i-task">#task</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="module-Rake::DSL">
    <h1 id="module-Rake::DSL" class="module">
      module Rake::DSL
    </h1>

    <section class="description">
    
<p><a href="DSL.html"><code>DSL</code></a> is a module that provides <a href="DSL.html#method-i-task"><code>task</code></a>, <a href="DSL.html#method-i-desc"><code>desc</code></a>, <a href="DSL.html#method-i-namespace"><code>namespace</code></a>, etc.  Use this when you’d like to use rake outside the top level scope.</p>

<p>For a Rakefile you run from the command line this module is automatically included.</p>

    </section>

      <section id="5Buntitled-5D" class="documentation-section">





                <section id="private-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Instance Methods</h3>
                </header>

                  <div id="method-i-desc" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">desc</span><span
                                class="method-args">(description)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Describes the next rake task.  Duplicate descriptions are discarded. Descriptions are shown with <code>rake -T</code> (up to the first sentence) and <code>rake -D</code> (the entire description).</p>

<p>Example:</p>

<pre>desc &quot;Run the Unit Tests&quot;
task test: [:build]
  # ... run tests
end</pre>

                              <div class="method-source-code" id="desc-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/dsl_definition.rb, line 165</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">desc</span>(<span class="ruby-identifier">description</span>) <span class="ruby-comment"># :doc:</span>
  <span class="ruby-constant">Rake</span>.<span class="ruby-identifier">application</span>.<span class="ruby-identifier">last_description</span> = <span class="ruby-identifier">description</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-directory" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">directory</span><span
                                class="method-args">(*args, &amp;block)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Declare a set of files tasks to create the given directories on demand.</p>

<p>Example:</p>

<pre class="ruby"><span class="ruby-identifier">directory</span> <span class="ruby-string">&quot;testdata/doc&quot;</span>
</pre>

                              <div class="method-source-code" id="directory-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/dsl_definition.rb, line 92</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">directory</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-comment"># :doc:</span>
  <span class="ruby-identifier">result</span> = <span class="ruby-identifier">file_create</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
  <span class="ruby-identifier">dir</span>, <span class="ruby-identifier">_</span> = <span class="ruby-operator">*</span><span class="ruby-constant">Rake</span>.<span class="ruby-identifier">application</span>.<span class="ruby-identifier">resolve_args</span>(<span class="ruby-identifier">args</span>)
  <span class="ruby-identifier">dir</span> = <span class="ruby-constant">Rake</span>.<span class="ruby-identifier">from_pathname</span>(<span class="ruby-identifier">dir</span>)
  <span class="ruby-constant">Rake</span>.<span class="ruby-identifier">each_dir_parent</span>(<span class="ruby-identifier">dir</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">file_create</span> <span class="ruby-identifier">d</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">mkdir_p</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">name</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">t</span>.<span class="ruby-identifier">name</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">result</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-file" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">file</span><span
                                class="method-args">(*args, &amp;block)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Declare a file task.</p>

<p>Example:</p>

<pre class="ruby"> <span class="ruby-identifier">file</span> <span class="ruby-string">&quot;config.cfg&quot;</span> <span class="ruby-operator">=&gt;</span> [<span class="ruby-string">&quot;config.template&quot;</span>] <span class="ruby-keyword">do</span>
   <span class="ruby-identifier">open</span>(<span class="ruby-string">&quot;config.cfg&quot;</span>, <span class="ruby-string">&quot;w&quot;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">outfile</span><span class="ruby-operator">|</span>
     <span class="ruby-identifier">open</span>(<span class="ruby-string">&quot;config.template&quot;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">infile</span><span class="ruby-operator">|</span>
       <span class="ruby-keyword">while</span> <span class="ruby-identifier">line</span> = <span class="ruby-identifier">infile</span>.<span class="ruby-identifier">gets</span>
         <span class="ruby-identifier">outfile</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">line</span>
       <span class="ruby-keyword">end</span>
     <span class="ruby-keyword">end</span>
   <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span>
</pre>

                              <div class="method-source-code" id="file-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/dsl_definition.rb, line 76</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">file</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-comment"># :doc:</span>
  <span class="ruby-constant">Rake</span><span class="ruby-operator">::</span><span class="ruby-constant">FileTask</span>.<span class="ruby-identifier">define_task</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-file_create" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">file_create</span><span
                                class="method-args">(*args, &amp;block)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Declare a file creation task. (Mainly used for the directory command).</p>

                              <div class="method-source-code" id="file_create-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/dsl_definition.rb, line 82</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">file_create</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
  <span class="ruby-constant">Rake</span><span class="ruby-operator">::</span><span class="ruby-constant">FileCreationTask</span>.<span class="ruby-identifier">define_task</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-import" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">import</span><span
                                class="method-args">(*fns)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Import the partial Rakefiles <code>fn</code>.  Imported files are loaded <em>after</em> the current file is completely loaded.  This allows the import statement to appear anywhere in the importing file, and yet allowing the imported files to depend on objects defined in the importing file.</p>

<p>A common use of the import statement is to include files containing dependency declarations.</p>

<p>See also the –rakelibdir command line option.</p>

<p>Example:</p>

<pre class="ruby"><span class="ruby-identifier">import</span> <span class="ruby-string">&quot;.depend&quot;</span>, <span class="ruby-string">&quot;my_rules&quot;</span>
</pre>

                              <div class="method-source-code" id="import-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/dsl_definition.rb, line 183</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">import</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">fns</span>) <span class="ruby-comment"># :doc:</span>
  <span class="ruby-identifier">fns</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">fn</span><span class="ruby-operator">|</span>
    <span class="ruby-constant">Rake</span>.<span class="ruby-identifier">application</span>.<span class="ruby-identifier">add_import</span>(<span class="ruby-identifier">fn</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-multitask" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">multitask</span><span
                                class="method-args">(*args, &amp;block)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Declare a task that performs its prerequisites in parallel. Multitasks does <strong>not</strong> guarantee that its prerequisites will execute in any given order (which is obvious when you think about it)</p>

<p>Example:</p>

<pre class="ruby"><span class="ruby-identifier">multitask</span> <span class="ruby-value">deploy:</span> <span class="ruby-node">%w[deploy_gem deploy_rdoc]</span>
</pre>

                              <div class="method-source-code" id="multitask-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/dsl_definition.rb, line 112</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">multitask</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-comment"># :doc:</span>
  <span class="ruby-constant">Rake</span><span class="ruby-operator">::</span><span class="ruby-constant">MultiTask</span>.<span class="ruby-identifier">define_task</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-namespace" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">namespace</span><span
                                class="method-args">(name=nil, &amp;block)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Create a new rake namespace and use it for evaluating the given block.  Returns a <a href="NameSpace.html"><code>NameSpace</code></a> object that can be used to lookup tasks defined in the namespace.</p>

<p>Example:</p>

<pre class="ruby"><span class="ruby-identifier">ns</span> = <span class="ruby-identifier">namespace</span> <span class="ruby-string">&quot;nested&quot;</span> <span class="ruby-keyword">do</span>
  <span class="ruby-comment"># the &quot;nested:run&quot; task</span>
  <span class="ruby-identifier">task</span> <span class="ruby-value">:run</span>
<span class="ruby-keyword">end</span>
<span class="ruby-identifier">task_run</span> = <span class="ruby-identifier">ns</span>[<span class="ruby-value">:run</span>] <span class="ruby-comment"># find :run in the given namespace.</span>
</pre>

<p>Tasks can also be defined in a namespace by using a “:” in the task name:</p>

<pre class="ruby"><span class="ruby-identifier">task</span> <span class="ruby-string">&quot;nested:test&quot;</span> <span class="ruby-keyword">do</span>
  <span class="ruby-comment"># ...</span>
<span class="ruby-keyword">end</span>
</pre>

                              <div class="method-source-code" id="namespace-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/dsl_definition.rb, line 135</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">namespace</span>(<span class="ruby-identifier">name</span>=<span class="ruby-keyword">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-comment"># :doc:</span>
  <span class="ruby-identifier">name</span> = <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Symbol</span>)
  <span class="ruby-identifier">name</span> = <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_str</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:to_str</span>)
  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">String</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-string">&quot;Expected a String or Symbol for a namespace name&quot;</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-constant">Rake</span>.<span class="ruby-identifier">application</span>.<span class="ruby-identifier">in_namespace</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-rule" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">rule</span><span
                                class="method-args">(*args, &amp;block)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Declare a rule for auto-tasks.</p>

<p>Example:</p>

<pre class="ruby"><span class="ruby-identifier">rule</span> <span class="ruby-string">&#39;.o&#39;</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-string">&#39;.c&#39;</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span>
  <span class="ruby-identifier">sh</span> <span class="ruby-string">&#39;cc&#39;</span>, <span class="ruby-string">&#39;-o&#39;</span>, <span class="ruby-identifier">t</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">t</span>.<span class="ruby-identifier">source</span>
<span class="ruby-keyword">end</span>
</pre>

                              <div class="method-source-code" id="rule-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/dsl_definition.rb, line 151</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">rule</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-comment"># :doc:</span>
  <span class="ruby-constant">Rake</span><span class="ruby-operator">::</span><span class="ruby-constant">Task</span>.<span class="ruby-identifier">create_rule</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-task" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          task(task_name)
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>
                      <div class="method-heading">
                        <span class="method-callseq">
                          task(task_name: dependencies)
                              </span>
                            </div>
                      <div class="method-heading">
                        <span class="method-callseq">
                          task(task_name, arguments &rarr; dependencies)
                              </span>
                            </div>

                            <div class="method-description">
                              <p>Declare a basic task.  The <code>task_name</code> is always the first argument.  If the task name contains a “:” it is defined in that namespace.</p>

<p>The <code>dependencies</code> may be a single task name or an Array of task names. The <code>argument</code> (a single name) or <code>arguments</code> (an Array of names) define the arguments provided to the task.</p>

<p>The task, argument and dependency names may be either symbols or strings.</p>

<p>A task with a single dependency:</p>

<pre class="ruby"><span class="ruby-identifier">task</span> <span class="ruby-value">clobber:</span> <span class="ruby-node">%w[clean]</span> <span class="ruby-keyword">do</span>
  <span class="ruby-identifier">rm_rf</span> <span class="ruby-string">&quot;html&quot;</span>
<span class="ruby-keyword">end</span>
</pre>

<p>A task with an argument and a dependency:</p>

<pre class="ruby"><span class="ruby-identifier">task</span> <span class="ruby-value">:package</span>, [<span class="ruby-value">:version</span>] <span class="ruby-operator">=&gt;</span> <span class="ruby-value">:test</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">t</span>, <span class="ruby-identifier">args</span><span class="ruby-operator">|</span>
  <span class="ruby-comment"># ...</span>
<span class="ruby-keyword">end</span>
</pre>

<p>To invoke this task from the command line:</p>

<pre>$ rake package[1.2.3]</pre>

                              <div class="method-source-code" id="task-source">
            <pre><span class="ruby-comment"># File rake-13.0.6/lib/rake/dsl_definition.rb, line 59</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">task</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-comment"># :doc:</span>
  <span class="ruby-constant">Rake</span><span class="ruby-operator">::</span><span class="ruby-constant">Task</span>.<span class="ruby-identifier">define_task</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is a service of <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>, purveyors of fine <a href='https://jamesbritt.bandcamp.com/'>dance noise</a></p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

